home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
027a
/
lxnet.zip
/
LX.DOC
next >
Wrap
Text File
|
1991-02-07
|
67KB
|
2,057 lines
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper
Copyright 1990 Randy Proulx.
1618 Marion Rd. SE #47
Rochester, MN 55904
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper i
Table of Contents
License Information . . . . . . . . . . . . 1
How to use this library . . . . . . . . . . 2
Features and limitations. . . . . . . . . . 3
Function Descriptions . . . . . . . . . . . 5
A_Connect() . . . . . . . . . . . . . . 5
A_Groups(). . . . . . . . . . . . . . . 6
A_Members() . . . . . . . . . . . . . . 7
A_Queues(), . . . . . . . . . . . . . . 8
A_Servers() . . . . . . . . . . . . . . 9
A_Users() . . . . . . . . . . . . . . .10
A_Volumes() . . . . . . . . . . . . . .11
Acct_stat() . . . . . . . . . . . . . .12
Attach(). . . . . . . . . . . . . . . .13
Cancel_Cap(). . . . . . . . . . . . . .15
CanSpecCap(). . . . . . . . . . . . . .16
Cap_Flags() . . . . . . . . . . . . . .17
Cap_Server(). . . . . . . . . . . . . .18
Cap_Status(). . . . . . . . . . . . . .19
Capture() . . . . . . . . . . . . . . .20
ConnectNum(). . . . . . . . . . . . . .21
Cur_Drive() . . . . . . . . . . . . . .22
Cur_Vol() . . . . . . . . . . . . . . .23
DefaultLpt(). . . . . . . . . . . . . .24
DefaultCon(). . . . . . . . . . . . . .25
Detach(). . . . . . . . . . . . . . . .26
EndCap(). . . . . . . . . . . . . . . .27
EndSpecCap(). . . . . . . . . . . . . .28
Flushcap(). . . . . . . . . . . . . . .29
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper ii
Table of Contents
(continued)
FluSpecCap(). . . . . . . . . . . . . .30
GetBanUser(). . . . . . . . . . . . . .31
GetLogCont(). . . . . . . . . . . . . .32
GetMap(). . . . . . . . . . . . . . . .34
GetObjID(). . . . . . . . . . . . . . .35
GetObjName(). . . . . . . . . . . . . .36
GetObjType(). . . . . . . . . . . . . .37
GetRights() . . . . . . . . . . . . . .38
GetUser() . . . . . . . . . . . . . . .39
IsInGroup() . . . . . . . . . . . . . .40
IsNovell(). . . . . . . . . . . . . . .41
Login() . . . . . . . . . . . . . . . .42
Logout(). . . . . . . . . . . . . . . .43
Map() . . . . . . . . . . . . . . . . .44
NumConnect(). . . . . . . . . . . . . .45
NumGroups() . . . . . . . . . . . . . .46
NumMembers(). . . . . . . . . . . . . .47
NumQueues() . . . . . . . . . . . . . .48
NumServers(). . . . . . . . . . . . . .49
NumSList(). . . . . . . . . . . . . . .50
NumUsers(). . . . . . . . . . . . . . .51
NumVolumes(). . . . . . . . . . . . . .52
SecurEquiv(). . . . . . . . . . . . . .53
Send(). . . . . . . . . . . . . . . . .54
ServDate(). . . . . . . . . . . . . . .56
ServTime(). . . . . . . . . . . . . . .57
SetDefCon() . . . . . . . . . . . . . .58
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper iii
Table of Contents
(continued)
SetDefLPT() . . . . . . . . . . . . . .59
SList() . . . . . . . . . . . . . . . .60
UserName(). . . . . . . . . . . . . . .61
WhoAmI(). . . . . . . . . . . . . . . .62
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 1
License Information
**NOTE This documentation is for both LXNet (Summer 87) and LXNet5
(5.0). Please note that each function will tell whether the
function works with Summer 87, all will work with 5.0.
LXNet (Summer 87) is shareware, LXNet5 (5.0) is not. LXNet
can be found on NANFORUM in lib 17 or lib 3. See below to
order LXNet5.
COPYRIGHT NOTICE
LXNet.lib is copyrighted, and all rights are reserved. It is being released
as shareware. It may be tested, copied, uploaded to public access bulletin
boards, and distributed in any manner where the recipient pays for no more
than the cost of the distribution. All original files must be included.
LXNet may not be bundled with any other programs, libraries, or functions
without the written permission of the author.
LXNet5.lib is copyrighted, and all rights are reserved. It is NOT
shareware. It is licensed to the user for a period of 20 years and
may not be used on more than one computer at a time. There are no
royalties due for any programs written using LXNet5. LXNet5 may not
be dis-assembled, un-compiled, or reversed engineered. You may not
include any portion of LXNet5.lib in any software not in it's final
form (.EXE).
RESTRICTIONS
LXNet functions may not be used in any application, for other than testing
purposes, by unregistered users. They may not be included in any application
that is in its final form, without registration.
DISCLAIMER
No guarantee of any kind is made in regards to these functions.
REGISTRATION
Use of LXNet may be registered by sending Twentyfive dollars to its author.
Any registered user may include the LXNet functions in any of his or her
applications that are for personal or corporate use, or that are distibuted
as .EXE applications. They are also entitled to make use of any upgrades
to the LXNet functions that are publicly available as shareware within
24 months of their original registration.
Note that registration does not provide the right to include LXNet
functions as part of any library of functions. Registration provides the
right to include LXNet functions only in applications distributed as .EXE
files.
To register LXNet, send $25.00 to: Randy Proulx
1618 Marion Rd. SE #47
Rochester, MN 55904
**NOTE While LXNet.lib is shareware, LXNet5.lib is not. LXNet5.lib
can be pruchased by sending $99.00 +5.00 shipping to:
Randy Proulx
1618 Marion RD SE #47
Rochester, MN 55904
or
using MasterCard/Visa call 1-507-280-6968
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 2
How to use this library
Two versions of this library are included. LXNet.lib is S87
compatible while LXNet5.lib is 5.0 compatible. LXNet5 has
a quite a few enhancments and added functions. Under each
function description, differences are noted and different
examples are included where there may be a difference.
S87:
This library needs no setup or special instructions. All you have
to do is include LXNet in you LIB or SEARCH parameters for PLINK.
If you don't use PLINK, you will have to follow the instructions for
your linker for adding libraries.
5.0:
To use LXNet5, you must add the line:
#include "lxnet.ch" (lxnet.ch should be in your include path
directory)
to your program. No special initialization functions are needed and
there are no special link instructions, just add LXNet5 to your library
list.
If you have any questions or request, I'm can be found on compuserve
user id [71621,3263]
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 3
Future Features, Current Limitations and Version History
These function will only work on Novell Networks, I have no idea what
would happen on another network operating system. This Library has been
tested with Novell Netware V2.12. It should work with all Netware
versions 2.0 and later (with the exception of some queue option and the
capture command on 2.0a servers) since the system calls are the same.
LXNet5 is designed for Clipper 5.0 while LXNet is designed for S87.
Changes from 1.0 (CLPNET)
Printing functions were added including Capture(), EndCap(),
FlushCap(), EndSpecCap(), FlushSCap(), CancelCap(), CanSpecCap(),
DefaultLPT(), GetBanUser(), A_Queues(), NumQueues().
A_Servers() and NumServers() were added.
IsNovell() was added.
Problem in A_Members was fixed. The problem caused A_Members to
return scambled user ids.
Changes from 1.1 LXNet (9-24-90)
Multiple server functions were added including DefaultCon() and
SetDefCon().
A_Volume() and NumVolumes() were added to get volume names.
UserName() was added to get the full user name.
ServTime() and ServDate() were added to get the server date and time.
Bug in IsNovell was fixed. This was called by many internals and
may have caused many functions to not work.
Additional 5.0 functions
GetLogCont() was added to get login control parameters.
Acct_Stat() was added to get accounting information.
Map() was added to set drive mapping
GetMap() was added to get drive mapping
SList() was added to get list of servers not already attached to.
Changes from 1.2 to 1.3
Addition of Acct_Stat(), Map(), GetMap(), SList(), MapTemp(),
and IsTempMap()
Addition of Attach(), Login(), Logout(), A_Connect(), NumConnect(),
Send(), SetDefLPT(), Cap_Flags(), Cap_Server(), Cap_Status(),
Cur_Drive(), Cur_Vol(), GetRights(), Detach(), Get_User()
Basically add all the functions supported by the 5.0 version.
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 4
Changes from 5.0 to 5.1
Addition of Attach(), Login(), Logout(), A_Connect(), NumConnect(),
Send(), SetDefLPT(), Cap_Flags(), Cap_Server(), Cap_Status(),
Cur_Drive(), Cur_Vol(), GetRights(), Detach(), Get_User()
Future releases will include the following:
A function to caston and castoff (set broadcast mode)
A function to get the Netware version number
Functions to write to the bindery
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 5
Function :A_Connect
Compatible :S87,5.0
Syntax :n_var=A_Connect(a_var)
Description :A_Connect will fill the array a_var with all valid connection
numbers and the object names logged into the connection number.
Each element is character in the format:CCC UUUUUU... where CCC
is the connection number and UUUUUU... is the user name. To get
just the connection number, use val(left(a_var[i],3)), to get
just the username, use right(a_var[i],len(a_var[i])-4). Only
connections with an object logged in will be added to the array.
a_var is sized to the correct size, but must be declared as an
array. A_Connect will return the number of valid connections
found.
Example :see Send() for example of A_Connect()
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 6
Function :A_Groups
Compatible :S87, 5.0
Syntax :n_var=A_Groups(a_var)
Description :A_Groups returns the Novell user groups in the array a_var.
S87:
A_var must be declared and have enough elements to hold all
the groups. NumGroups() can be used when declaring a_var
to set the correct number of elements.
5.0:
A_var will be sized automatically, it need only be declared
as an array. The contents of a_var will be destroyed upon
entrance to A_Groups. The 5.0 version will return the number
of groups in a_var.
Example S87 :public groups[NumGroups()]
A_Groups(groups)
for i=1 to NumGroups()
? groups[i]
next
Example 5.0 :private groups[0]
local numgroups
numgroups:=A_Groups(groups)
for i=1 to numgroups
? groups[i]
next
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 7
Function :A_Members
Compatible :S87, 5.0
Syntax :nvar:=A_Members(a_var,groupname)
Description :A_Members returns all the members of the group groupname in
the array a_var.
S87:
A_var must be declared and have enough elements to hold all
the groups. NumMembers() can be used when declaring a_var
to set the correct number of elements.
5.0:
A_Var is sized automatically, it needs to be declared as an
array only. The 5.0 version will return the number of members
in a_var.
Example S87 :public members[NumMembers('EVERYONE')]
A_Members(members,'EVERYONE')
for i=1 to NumMembers('EVERYONE')
? members[i]
next
Example 5.0 :private members[0],n_members
n_members:=A_Members(members,'EVERYONE')
for i=1 to n_members
? members[i]
next
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 8
Function :A_Queues
Compatible :S87, 5.0
Syntax :n_var=A_Queues(a_var)
Description :A_Queues returns all the print queues available on the
default server in the array a_var.
S87:
A_var must be declared and have enough elements to hold all
the queues. NumQueues() can be used when declaring a_var
to set the correct number of elements.
5.0:
A_Var is sized automatically, it needs to be declared as an
array only. The 5.0 version will return the number of queues
in a_var.
Example S87 :public queues[NumQueues()]
A_Queues(queues)
for i=1 to NumQueues()
? queues[i]
next
Example 5.0 :private queues[0],n_queues
n_queues:=A_Queues(queues)
for i=1 to n_queues
? queues[i]
next
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 9
Function :A_Servers
Compatible :S87, 5.0
Syntax :n_var=A_Servers(a_var)
Description :A_Servers returns all the server names that the workstation
is logged into in the array a_var. The File Server Table
will contain the server names in element that the server
resides in the Novell Table. The array may be sparce since
the servers may retain their original position if a server
has lost connection.
S87:
A_var must be declared as having 8 elements since the array
may be sparce.
5.0:
A_var is sized to 8 elements automatically. n_var will return
the actual number of servers in the array.
Example S87 :public servers[NumServers()] &&or public servers[8]
n_servs=A_Servers(servers)
for i=1 to n_servs
if !empty(servers[i])
? servers[i]
endif
next
Example 5.0 :private servers[0]
n_servs=A_Servers(servers)
for i=1 to n_servs
if !empty(servers[i])
? servers[i]
endif
next
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 10
Function :A_Users
Compatible :S87, 5.0
Syntax :n_var=A_Users(a_var)
Description :A_Users fills the array a_var with all the usernames for
the default server and returns the number of users in the
array.
S87:
a_var must be declared and have enough elements to hold all
the users. NumUsers() can be used when declaring a_var to
set the correct number of elements.
5.0:
a_var need not be sized, A_Users will size the array, a_var
must be declared as an array. Any valued in a_var will be
lost since the array size is set to 0 (using asize()) and
then each user name is added to the array (using aadd()).
Example S87 :public users[NumUsers()]
A_Users(users)
for i=1 to NumUsers()
? users[i]
next
Example 5.0 :local users[0]
A_Users(users)
for i:=1 to len(users)
? users[i]
next
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 11
Function :A_volumes
Compatible :S87, 5.0
Syntax :A_volumes(a_var)
Description :A_volumes returns all the volume names for the default server.
S87:
A_var must be declared and have enough elements to hold all
the volumes. NumVolumes() can be used when declaring a_var to
set the correct number of elements.
5.0:
A_Var is sized automatically, it needs to be declared as an
array only. The 5.0 version will return the number of volumes
in a_var.
Example S87 :public volumes[NumVolumes()]
A_Volumes(volumes)
for i=1 to NumVolumes()
? volumes[i]
next
Example 5.0 :private volumes[0],n_vols
n_vols:=A_Volumes(volumes)
for i=1 to n_vols
? volumes[i]
next
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 12
Function :Acct_Stat
Compatible :S87,5.0
Syntax :nvar=Acct_Stat(ObjectName,; /*charact*/
ObjectType,; /*numeric*/
@AcctBal,; /*numeric*/
@CredLimit,; /*numeric*/
HoldServersArray,; /*array */
HoldAmountsArray) /*array */
Description :Acct_Stat returns the current accounting status of an object.
Acct_Stat returns 5 if the objectname and/or the objecttype
are not of the correct type or 2 if an error occurs reading
the accounting property. An error reading the accounting
property can result from the accounting not being installed,
or the logged-in object does not have bindery read rights.
Read rights include the object logged in (you can only get
or own account balance) or supervisor equivalence.
Acct_Stat will store values into AcctBal (current account
balance), CredLImit (credit limit, 8000000h if no limit),
the servers that have placed holds on the account and the
amounts those servers are holding. The hold amount refer
to upcoming services that have requested reserving an
amount that will be subtracted from the account balance when
the particular service is complete. This is to ensure that
the account will have enough credit to pay for the service
before the service is complete. Each server will hold one
amount for all pending services on that server.
Example :
function useracctba
private acctbal,credlim,a_status
acctbal=0
credlim=0
a_status=acct_stat(users[pcurrow],USER_OBJECT,@acctbal,@credlim)
@ 8,15,10,65 box '╔═╗║╣═╠║ '
@ 10,15,14,65 box '╠═╣║╝═╚║ '
@ 9,16 say 'Account Balance For User '+users[pcurrow]
@ 11,17 say 'Account Balance :'
@ 12,17 say 'Allow Unlimited Credit:'
@ 13,17 say 'Low Balance Limit:'
@ 11,50 say acctbal picture '9999999999'
@ 12,50 say if(dec2hex(credlim)='80000000','Yes','No')
@ 13,50 say if(dec2hex(credlim)='80000000','',;
transform(credlim,'9999999999'))
@ 15,50 say dec2hex(credlim)
wait ''
return .t.
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 13
Function :Attach
Compatible :S87,5.0
Syntax :n_var=Attach(ServerName)
Description :Attach will establish a connection to the server ServerName
allowing the workstation to login to that server. A note on
server and connection numbers is needed here.
A workstation shell has a connection ID table that
will hold the internetwork address and connection ID for
each of upto eight servers that it is attached to. The
server from which the login script is run is designated as
the primary server. Other servers attached later on may
be designated as a perferred server (see SetDefCon).
Operations are always performed on the preferred server
unless another server is specified (ie. Map, login, capture,
etc.). Attaching a server using Attach() will only
add the server to the connection ID table, this is different
from Novell's ATTACH command which also makes you log into the
file server. After using Attach(), you should login into the
server using Login(). A list of all servers is kept in the
primary servers bindery under the object type FILE_S_OBJECT.
SList() will load an array with these values less any server
found in the connection ID table. A_Servers will load an
array with the servers in the connection ID table.
Attach() will return either the server slot number (1-8) or an
error code (>8). Error codes are as follows:
249 = Error reading property value for server
*250 = Already attached to server
251 = No Free connections slots at server
252 = No more server slots
253 = Unknown file server
254 = Server bindery locked
255 = No response from server
*If you try to attach to a server already in the connection ID
table, Attach() will return the server # of that server, so
you should never receive error 250
The server number returned should be set as the preferred
connection (SetDftCon()) when any operation you wish is to
be performed on that server. You may also get the server
number by scanning an array loaded with A_Servers() for the
server name.
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 14
Function:Attach (continued)
Example :#include "lxnet.ch" &&5.0 only
function my_login
parameters servername,username,password
private server_num,old_server,flag
private user_object &&S87 only
user_object=1 &&S87 only
flag=.t.
password=if(type('password')='U','',password)
server_num=attach(servername)
if server_num<9
old_server=defaultcon()
setdefcon(server_num)
if !login(username,password,USER_OBJECT) &&
popmess(10,10,'Login failed')
flag=.f.
endif
setdefcon(old_server) &&restore old server as default
else
popmess(10,10,'Login failed')
flag=.f.
endif
return flag
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 15
Function :Cancel_Cap
Compatible :S87, 5.0
Syntax :Cancel_Cap()
Description :Cancel_Cap cancels the capture in progress for the default
LPT printer port. Any output not already printed will be
removed from the queue.
Example :capture('/q=myqueue /ti=0 /nb /nt')
set device to print
&&report begins
.
. user presses <ESC> to cancel report
. and set cancel_report to .t.
.
if cancel_report
cancel_cap()
else
endcap()
endif
set device to screen
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 16
Function :CanSpecCap
Compatible :S87, 5.0
Syntax :CanSpecCap(lptport)
Description :CanSpecCap cancels the capture in progress for the specified
LPT printer port. Any output not already printed will be
removed from the queue. lptport can have the values of 1, 2,
or 3 for ports LPT1, LPT2, or LPT3.
Example :capture('/q=myqueue /ti=0 /nb /nt /l=2')
&& /l=2 will set capture to for LPT2
set device to print
set printer to LPT2 &&tells Clipper to use LPT2
&&report begins
.
. user presses <ESC> to cancel report
. and set cancel_report to .t.
.
if cancel_report
CanSpecCap(2)
else
EndSpecCap(2)
endif
set device to screen
set printer to
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 17
Function :Cap_Flags
Compatible :S87,5.0
Syntax :l_var=Cap_Flags(LPT_Port,; /*numeric */
@Queue_Name,; /*character */
@Server_Name,; /*chatracter */
@FormFeed,; /*logical */
@No_Tab_Conversion,; /*logical */
@Print_Banner,; /*logical */
@Tab_Conv_Size,; /*numeric */
@Server_Printer,; /*numeric */
@Copies,; /*numeric */
@Form_Number,; /*numeric */
@Banner_Text,; /*character */
@LPT_Captured,; /*numeric */
@Time_Out_Seconds,; /*numeric */
@Auto_End_Cap,; /*logical */
@Form_Name) /*character */
Description :Cap_Flags is used to get the current capture characteristics
of the specified LPT port. If no capture is active, the last
values used are returned. Queue_Name will return a zero length
string if no queue name was specified for the capture (only a
server printer # was specified). If No_Tab_Conversion is .t.,
Tab_Conv_Size has no meaning. If Print_Banner is .f.,
Banner_Text has no meaning. LPT_Captured should return the
same value as LPT_Port. The rest of the parameters are
self explanitory. Cap_Flags will return .t. unless LPT_Port
is not numeric.
** All parameter (with the exception of LPT_Port) are optional,
but any parameter requested must be initialized to a value.
This is because Clipper cannot tell the difference between a
parameter that has been skipped and one that has not been
initialized (both have a value of NIL). Parameters may be
skipped by not specifying a variable, just a comma.
Example 5.0 :
private qname,server,formfeed,notab,banner,tabsize,printer,;
copies,form,bannertext,lpt,timeout,autoend,formname
store 0 to qname,server,formfeed,notab,banner,tabsize,printer,;
copies,form,bannertext,lpt,timeout,autoend,formname
cap_flags(1,@qname,@server,@formfeed,@notab,@banner,@tabsize,@printer,;
@copies,@form,@bannertext,@lpt,@timeout,@autoend,@formname)
@ 10,10 say 'Current capture is to the server '+server+;
if(len(qname)!=0,', Queue '+qname,',' Printer '+str(printer,1))
@ 11,10 say 'Form # :'+str(form,3)
@ 11,40 say 'Tabs :'+if(notab,'Not converted','Converted to '+;
str(tabsize,3)+' spaces')
@ 12,10 say 'Copies :'+str(copies,3)
@ 12,40 say 'FormFeed :'+if(formfeed,'On','Off')
@ 13,10 say 'Time out :'+if(timeout=0,'None',str(timeout,5))
@ 13,40 say 'Auto End :'+if(autoend,'On','Off')
@ 14,10 say 'Banner :'+if(banner,bannertext,'None')
wait
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 18
Function :Cap_Server
Compatible :S87,5.0
Syntax :n_var=Cap_Server(LPT_Port)
Description :Cap_Server will return the server slot # of the server that
the specified LPT capture is going to.
Example 5.0 :private servers[8] &&8 is the max # of attached servers
a_servers[servers]
if !cap_status(1)
? 'LPT1 capturing server is '+servers[cap_server()]
else
? 'Capture for LPT1 is not active'
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 19
Function :Cap_Status
Compatible :S87,5.0
Syntax :l_var=Cap_Status(LPT_Port)
Description :Cap_Status will return .t. if the specified capture lpt port
is captured, .f. if no capture is active.
Example 5.0 :if !cap_status(1)
capture('qlaser ti0 nff')
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 20
Function :Capture
Compatible :S87, 5.0
Syntax :Capture(option_string)
Description :Capture will end the current capture and start a new one
using the options specified in option_string. Options
available are:
/q=<queue name>
/b=<banner name>
/ti=<timeout value in seconds>
/t=<tab replacement value (number of spaces)>
/ff formfeed after capture
/nff no formfeed after capture
/p=<server printer (0-4)>
/l=<LPT port number (1-3)
/f=<form number or form name>
/nam=<banner user name>
/a auto endcap (endcap when job is done)
/na no auto endcap
/c=<copies>
/nt no tab expansion
The / and the = are optional, all options must be seperated
by a space though. If you specify a queue name, you shouldn't
specify a server printer number. Specifing conflicting options
(such as both /a and /na) will have unpredictable results. The
banner name, queue name, and the form name cannot have any
spaces in them
Example :capture('/q=laser2 /ti=0 /nb /nt /l=2 /bBal_stmnt ff')
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 21
Function :ConnectNum
Compatible :S87, 5.0
Syntax :n_var=ConnectNum()
Description :ConnectNum returns the Novell connection number (1-250) of the
workstation making the call on the default file server. This
number is unique to the station on the default file server.
The connection number is often useful in generating unique
filenames for temporary files. This number is determined by
the file server and can change for the workstation when the
station is powered down (although Novell will try to reserve
the same number for the station).
Example :tmpfilename='TMP'+ltrim(str(connectnum()))
use customer index customer
copy to (tmpfilename) for state='MN'
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 22
Function :Cur_Drive
Compatible :S87,5.0
Syntax :c_var=Cur_Drive()
Description :Cur_Drive will return the current disk drive including the
colon.
Example 5.0 :if cur_drive()<>'G:'
set default to G:
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 23
Function :Cur_Vol
Compatible :S87,5.0
Syntax :c_var=Cur_Vol()
Description :Cur_Vol will return the volume name of the default disk drive
including the the trailing colon.
Example 5.0 :if getrights(cur_vol()+'.')!='RWOCD'
@ 10,10 say 'You do not have enough rights to this directory'
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 24
Function :DefaultLPT
Compatible :S87, 5.0
Syntax :n_var=DefaultLpt()
Description :DefaultLPT will return the default LPT number (1-3) used
with the capture command.
Example :if defaultlpt()<>2
set printer to LPT2
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 25
Function :DefaultCon
Compatible :S87, 5.0
Syntax :n_var=DefaultCon()
Description :DefaultCon will return the preferred connection ID number (1-8)
that correspondse with the server list. This function is used
to get the preferred server number when multiple servers are
available. Defaultcon will return 0 if no preferred server
is set.
How the active server is determined:
1) if the server is specified in the function, that
server will be used.
2) if no server is specified, the preferred server (if
set) will be used.
3) if no server is specified and no preferred server
is set, the server that the current drive
(if networked) is logged into is used
4) if no server is specified, no preferred server is set,
and the current drive is not a network drive, then the
primary server is used (the primary server is the server
that the user logged into).
5) finally, if the primary server connection is lost, the
first server in the server table is used.
Example :&&to capture to a non-preferred (if available)
private servers[numservers()]
a_servers(servers)
if ascan(servers,'SERVER-2')<>0
oldserver=defaultcon()
setdefcon(ascan(servers,'SERVER-2'))
capture('qlaser nb ti0 nt')
setdefcon(oldserver)
else
capture('qokidata_3 nb ti0 nt')
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 26
Function :Detach
Compatible :S87,5.0
Syntax :l_var=Detach(Server_Number)
Description :Detach will remove a server from the connection ID table
(see Attach() for description of connection ID table).
This function will most likely be used if you need
to connect to a server and the connection ID table is
full. It may be good practice to detach from a server when
you log out from a server if you anticipate that you may
run out of server slots in the connection ID table. Detach()
will return .t. if successful, .f. if server was not attached.
Example :function my_logout
parameters servername
private serv_num,servers[8]
a_servers(servers)
serv_num=ascan(servers,servername)
if serv_num>0
logout(serv_num)
if serv_num>1 &&should always leave one server attached
detach(serv_num)
endif
endif
return .t.
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 27
Function :EndCap
Compatible :S87, 5.0
Syntax :l_var=EndCap()
Description :EndCap will end and release the capture for the default LPT
port. L_var will return .t. if successfull, otherwise .f.
Example :capture('qlaser nt nb ff')
*print report
endcap()
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 28
Function :EndSpecCap
Compatible :S87, 5.0
Syntax :l_var=EndSpecCap(lptport)
Description :EndSpecCap will end and release the capture for the specified
LPT port. L_var will return .t. if successfull, otherwise .f.
Example :capture('qlaser nt nb ff l2')
*print report
endspeccap(2)
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 29
Function :FlushCap
Compatible :S87, 5.0
Syntax :l_var=FlushCap()
Description :FlushCap will release the capture for the default LPT port.
A new capture with the same parameters will be issued for
the LPT port. L_var will return .t. if successfull, otherwise
.f.
Example :capture('qlaser nt nb ff')
*print report
flushcap()
*print another report
endcap()
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 30
Function :FluSpecCap
Compatible :S87, 5.0
Syntax :l_var=FluSpecCap(lptport)
Description :FluSpecCap will release the capture for the specified LPT port.
A new capture with the same parameters will be issued for
the LPT port. L_var will return .t. if successfull, otherwise
.f.
Example :capture('qlaser nt nb ff l2')
*print report
fluspeccap(2)
*print another report
endcap(2)
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 31
Function :GetBanUser
Compatible :S87, 5.0
Syntax :c_var=GetBanUser()
Description :GetBanUser will return the banner user name that prints on the
banner page of captured printouts. Use the Capture command to
set the banner user name.
Example :buser=getbanuser()
capture('qlaser nt ff b'+trim(left(buser,5))+'_AP')
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 32
Function :GetLogCont
Compatible :S87, 5.0
Syntax :GetLogCont(UserName /*string */
@Account_Disabled,; /*logical*/
@Account_Expires,; /*date */
@Concurrent_Connection_Limit,; /*numeric*/
@User_Can_Change_Password,; /*logical*/
@User_Password_Required,; /*logical*/
@Minimum_Password_Length,; /*numeric*/
@Force_Periodic_Password_Change,; /*logical*/
@Days_Between_Password_Change,; /*numeric*/
@Date_Current_Password_Changes,; /*date */
@Grace_Logins_Permitted,; /*numeric*/
@Grace_Logins_Left,; /*numeric*/
@Require_Unique_Passwords) /*logical*/
Description :GetLogCont will return the login control for the specified
user. The login control for a user is stored in the
bindery file under the object for the user. The values are
stored in the property value LOGIN_CONTROL. All parameters
are required but depending on the values retreived from the
bindery, some may have no meaning.
If the account is disabled, all other values are meaningless.
The maxinum concurrent connections will be 0 if no limit is
set. If a password is not required, minimum_password_length,
forced_periodic_password_change, days_between_password_change,
Date_current_password_changes,grace_logins_permitted, and
grace_logins_left will have no meaning. If the
grace_logins_permitted is 0, there is an unlimited # of grace
logins and the grace_logins_left is meaningless.
Example : (see next page)
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 33
Function :GetLogCont (continued)
function useracctre
private disabled,acctexpire,connlimit,userpw,pwreq,pwlen,pwchng,;
pwdays,pwexpire,grace,graceleft,pwunique
getlogcont(users[pcurrow],@disabled,@acctexpire,@connlimit,@userpw,@pwreq,@pwlen,;
@pwchng,@pwdays,@pwexpire,@grace,@graceleft,@pwunique)
@ 5,10,7,70 box '╔═╗║╣═╠║ '
@ 7,10,23,70 box '╠═╣║╝═╚║ '
@ 6,16 say 'Account Restrictions For User '+users[pcurrow]
@ 08,12 say 'Account Disabled:'
@ 09,12 say 'Account Has Expriation Date:'
@ 10,12 say ' Date Account Expires:'
@ 11,12 say 'Limit Concurrent Connections:'
@ 12,12 say ' Maximum Connections:'
@ 13,12 say 'Allow User to Change Password:'
@ 14,12 say 'Require Password:'
@ 15,12 say ' Minimum Password Length:'
@ 16,12 say 'Force Periodic Password Change:'
@ 17,12 say ' Days Between Forced Change:'
@ 18,12 say ' Date Password Expires:'
@ 19,12 say ' Limit Grace Logins:'
@ 20,12 say ' Grace Logins Allowed:'
@ 21,12 say ' Remaining Grace Logins:'
@ 22,12 say 'Require Unique Passwords:'
@ 08,45 say if(disabled,'No','Yes')
@ 09,45 say if(acctexpire=ctod(' / / '),'No','Yes')
@ 10,45 say if(acctexpire=ctod(' / / '),'',acctexpire)
@ 11,45 say if(connlimit=0,'No','Yes')
@ 12,45 say if(connlimit=0,'',str(connlimit,3,0))
@ 13,45 say if(userpw,'Yes','No')
@ 14,45 say if(pwreq,'Yes','No')
@ 15,45 say if(pwreq,str(pwlen,3),'')
@ 16,45 say if(pwchng,'Yes','No')
@ 17,45 say if(pwchng,str(pwdays,3),'')
@ 18,45 say if(pwchng,pwexpire,'')
@ 19,45 say if(pwchng,if(grace=0,'No','Yes'),'')
@ 20,45 say if(pwchng,if(grace=0,'',str(grace,3)),'')
@ 21,45 say if(pwchng,if(grace=0,'',str(graceleft,3)),'')
@ 22,45 say if(pwunique,'Yes','No')
wait''
return .t.
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 34
Function :GetMap
Compatible :S87,5.0
Syntax :c_var=GetMap(DriveLetter)
Description :GetMap will return the current path for DriveLetter. If
the drive letter is invalid or the drive is not mapped,
GetMap will return a zero length string. The entire path
including the volume name is returned without the trailing \.
Example :if getmap('G')<>'VOL1:\ORDER'
oldmapg:=getmap('G')
map('G','VOL1:\ORDER')
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 35
Function :GetObjID
Compatible :S87, 5.0
Syntax :n_var=GetObjID(obj_type,obj_name)
Description :Novell's bindery consist of entirely of objects. Each object
has an object type (either user, group, queue, etc.) and
one or more properties. The properties can have either a value
or a set of values. For a user, the object will have
properties for the user_name (just a value), a property for
the groups the user belongs to (a set of values) and gobs of
other properties for the user. Each object can be
identified by either it's object ID number or by its name and
the type. It is often useful to know the object ID of an
object such as a print queue (if you desire to write your
own capture, or something) but all of the LXNet functions
use names and types. The GetObjID is used mostly internally
by functions to convert from name to object ID for you.
Object Types:
FFFFh wildcard
0 Unknown
1 User
2 User Group
3 Print Queue
4 File Server
5 Job Server
6 Gateway
7 Print Server
8 Archive Queue
9 Archive Server
Ah Job Queue
Bh Administration
26h Remote Bridge Server
47h Advertising Print Server
thru 8000h Reserved
(See lxnet.ch for object type constants)
Example :maildir='\mail\'+makehex(getobjid(1,whoami()))
if !file(maildir+'\*.ML')
? 'no mail in you mail directory'
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 36
Function :GetObjName
Compatible :S87, 5.0
Syntax :c_var=GetObjName(objectid)
Description :GetObjName will return the name of an Object ID (see GetObjID
for description of Object ID's). This function is used
internally for the most part but can be called by clipper if
needed.
Example :? GetObjName(GetObjID(2,'EVERYONE'))
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 37
Function :GetObjType
Compatible :S87, 5.0
Syntax :n_var=GetObjType(objectid)
Description :GetObjType will return the type of an Object ID (see GetObjID
for description of Object ID's). This function is used
internally for the most part but can be called by clipper if
needed.
Example :if GetObjType(GetObjID(find_object))=2
? find_object+' is a group'
else
? find_object+' not is a group'
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 38
Function :GetRights
Compatible :S87,5.0
Syntax :c_var=GetRights(Path)
Description :GetRights will return the effective access rights for the
specified directory. The Path must include the volume name
(use Cur_Vol() to get current volume, or GetMap() to get the
volume name of any other drive). The access rights
are returned as a character string with a length of eight.
Each position in the string represent a right with the
following format:
RWOCDPSM
R=Read Rights
W=Write Rights
O=Open Rights
C=Close Rights
D=Delete Rights
P=Parental Rights
S=Search Rights
M=Modify Rights
Typical return values might be
RWOC S
R OC S
RWOCD
RWOCDPSM
Example 5.0 :if getrights(cur_vol()+'.')!='RWOCD'
@ 10,10 say 'You do not have enough rights to this directory'
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 39
Function :GetUser
Compatible :S87,5.0
Syntax :c_var=GetUser(Connection_Number)
Description :GetUser will return the object name logged into the connection
number Connection_Number.
Example 5.0 :
&&this function is already included in LXNET5, I'm just using
&&it here as an example for getuser()
function a_connect
parameters _varray
private i,n
n=0
asize(_varray,0)
if isnovell()
for i=1 to 250 &&250 for Netware 3.x compatibility
if !(getuser(i)=='')
aadd(_varray,'')
_varray[n+1]=str(i,3)+' '+getuser(i)
n=n+1
endif
next
endif
return n
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 40
Function :IsInGroup
Compatible :S87, 5.0
Syntax :l_var=IsInGroup(username,groupname)
Description :IsInGroup will return a true if username is a member of
groupname. This function is useful for setting up
module security based on Novell's groups.
Example :if IsInGroup(WhoAmI(),'ADMINISTRATION')
FinReport()
else
? 'You do not have rights to print financial reports'
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 41
Function :IsNovell
Compatible :S87, 5.0
Syntax :l_var=IsNovell()
Description :IsNovell returns .t. if the Novell Shell is loaded.
Example :if isnovell()
capture('qlaser nb ti10')
endif
set device to print
*print report
set device to screen
if isnovell()
endcap()
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 42
Function :Login
Compatible :S87,5.0
Syntax :l_var=Login(ObjectName,Password[,Object_Type])
Description :Login will log an object into an attached server. The server
must be attached (with Attach() or previously logged into) and
be selected as the preferred server (using SetDefCon()).
ObjectName is the user or printserver name, password must
be passed, if the object doesn't have a password, pass an
empty string. If Object_Type is not passed, a user object type
is assumed.
Example 5.0 :#include "lxnet.ch"
function my_login
parameters servername,username,password
private server_num,old_server,flag
flag=.t.
password=if(type('password')='U','',password)
server_num=attach(servername)
if server_num<9
old_server=defalutcon()
setdefcon(server_num)
if !login(username,password,USER_OBJECT)
popmess(10,10,'Login failed')
flag=.f.
endif
setdefcon(old_server)
else
popmess(10,10,'Login failed')
flag=.f.
endif
return flag
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 43
Function :Logout
Compatible :S87,5.0
Syntax :=Logout(Server_Number)
Description :Logout will log an object out of the specified server but
leave the server attached. All drive mappings to the
server will be removed by the shell. Logout does not
return a value.
Example 5.0 :function my_logout
parameters servername
private serv_num,servers[0]
a_servers(servers)
serv_num=ascan(servers,servername)
if serv_num>0
logout(serv_num)
if serv_num>1
detach(serv_num)
endif
endif
return .t.
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 44
Function :Map
Compatible :S87,5.0
Syntax :l_var=Map(Drive_Letter,New_Path)
Description :Map will assign Drive_Letter to New_Path. The Drive_Letter
must be A..Z. New_Path may include a volume name but not
a server name, only the primary server will be used. To
map to a non-primary server, use SetDefCon() to set the
primary server. Map will return a status flag with the
following values:
0 successfull
1 invalid parameters
98h volume not found
9Ch invalid path
Example 5.0 :function OpenGLTRS
local status,errorflag
errorflag:=.f.
status:=map('M','ACCT:\AM\SIS3')
if status<>0
popmess(10,10,'Accounting directory not found')
errorflag:=.t.
endif
if !errorflag
usefile('GLTRS','M:GLTRS'+G_compno,'M:GLTRS'+G_compno+'.NTX')
endif
return !errorflag
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 45
Function :NumConnect
Compatible :S87, 5.0
Syntax :n_var=NumConnect()
Description :NumConnect returns the number of users logged into the default
file server.
Example :private conns[NumConnect()]
A_Connect(conns)
for i=1 to NumConnect()
? conns[i]
next
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 46
Function :NumGroups
Compatible :S87, 5.0
Syntax :n_var=NumGroups()
Description :NumGroups returns the number of groups in the bindery.
It is usually used in conjunction with A_Groups().
Example :public groups[NumGroups()]
A_Groups(groups)
for i=1 to NumGroups()
? groups[i]
next
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 47
Function :NumMembers
Compatible :S87, 5.0
Syntax :n_var=NumMembers(groupname)
Description :NumMembers returns the number of members in groupname.
It is usually used in conjunction with A_Members().
Example :public members[NumMembers('EVERYONE')]
A_Members(members,'EVERYONE')
for i=1 to NumMembers('EVERYONE')
? members[i]
next
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 48
Function :NumQueues
Compatible :S87, 5.0
Syntax :n_var=NumQueues()
:NumQueues returns the number of print queues for the default
file server. It is usually used in conjunction with A_Queues().
Example :public queues[NumQueues()]
A_Queues(queues)
for i=1 to NumQueues()
? queues[i]
next
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 49
Function :NumServers
Compatible :S87, 5.0
Syntax :n_var=NumServers()
:NumServers returns the number of servers that are reporting to
the workstation. It is usually used in conjunction with
A_Servers().
Example :public servers[NumServers()]
A_Servers(servers)
for i=1 to NumServers()
? servers[i]
next
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 50
Function :NumSList
Compatible :S87, 5.0
Syntax :n_var=NumSList()
Description :NumSList returns the number of servers not attached.
Example :private not_logged[NumSList()]
SList(Not_logged)
for i=1 to NUmSList()
? Not_Logged[i]
next
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 51
Function :NumUsers
Compatible :S87, 5.0
Syntax :n_var=NumUsers()
Description :NumUsers returns the number of users for the default file
server. It is usually used in conjunction with A_Users().
Example :public users[NumUsers()]
A_Users(users)
for i=1 to NumUsers()
? users[i]
next
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 52
Function :NumVolumes
Compatible :S87, 5.0
Syntax :n_var=NumVolumes()
Description :NumVolumes returns the number of volumes for the default file
server. It is usually used in conjunction with A_Volumes().
Example :public volumes[NumVolumes()]
A_Volumes(users)
for i=1 to NumVolumes()
? volumes[i]
next
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 53
Function :SecurEquiv
Compatible :S87, 5.0
Syntax :l_var=SecurEquiv(username,objectname)
Description :SecurEquiv will return true if username has the security
equivilance as objectname. Objectname can be either a
user or a group.
Example :if SecurEquiv(WhoAmI(),'SUPERVISOR')
maint_menu()
else
? 'Must be Supervisor to run maintenance'
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 54
Function :Send
Compatible :S87,5.0
Syntax :n_var=Send(Connection_Number,Message)
Description :Send will send a broadcast message to logical connection number
Connection_Number. Connection_Number is a value between 1 and
100 (Netware 2.x) and 1 to 250 (3.x). Message has a maximum
length of 55 characters. You may use A_Connect() to get the
connection number of all users logged in or GetUser() to get
the user of a connection number. Send will return 0 if no
error has occurred or an error code as follows:
0xFC Message rejected (message already waiting for
the target connection)
0xFD Invalid connection number (specified connection
is not known)
0xFF Message blocked (The target connection has castoff
or the connection is not in use)
Example S87 :
function my_send
private message,mscrn,connects[numconnect()+1],i,status,gets
mscrn=savescreen(10,10,12,70)
message=space(54-len(whoami()))
a_connect(connects)
@ 10,10 to 12,70
@ 11,11 clear to 11,69
*n_savegets(gets) &&if you have Communications Horizons GET-IT!
@ 11,11 say 'Message:' get message
read
*n_restgets(gets) &&if you have Communications Horizons GET-IT!
restscreen(10,10,12,70,mscrn)
if lastkey()=27
return .t.
endif
mscrn=savescreen(10,10,20,40)
@ 10,10 to 20,40
do while .t.
@ 11,11 clear to 19,39
i=achoice(11,11,19,39,connects)
if i=0
exit
endif
status=send(val(left(connects[i],3)),whoami()+':'+message)
if status=0
adel(connects,i)
else
popmess(10,10,'Error sending to '+connects[i])
endif
if len(connects)=0
exit
endif
enddo
restscreen(10,10,20,40,mscrn)
return .t.
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 55
Function: Send (continued)
Example 5.0 :
function my_send
private message,mscrn,getlist[0],connects[0],i,status,gets
mscrn=savescreen(10,10,12,70)
message=space(54-len(whoami()))
a_connect(connects)
@ 10,10 to 12,70
@ 11,11 clear to 11,69
@ 11,11 say 'Message:' get message
read
restscreen(10,10,12,70,mscrn)
if lastkey()=27
return .t.
endif
mscrn=savescreen(10,10,20,40)
@ 10,10 to 20,40
do while .t.
@ 11,11 clear to 19,39
i=achoice(11,11,19,39,connects)
if i=0
exit
endif
status=send(val(left(connects[i],3)),whoami()+':'+message)
if status=0
adel(connects,i)
asize(connects,len(connects)-1)
else
popmess(10,10,'Error sending to '+connects[i])
endif
if len(connects)=0
exit
endif
enddo
restscreen(10,10,20,40,mscrn)
return .t.
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 56
Function :ServDate
Compatible :S87, 5.0
Syntax :d_var=ServDate()
Description :ServDate will return the server date in clipper date format.
Server date and times are not synchronized on an inter-
network, so the server date will come from the default file
server. Use SetDefCon() to designate which server to get
the date (or time) from if you have multiple servers available.
Any year before 1980 is assumed to be in the 21st century.
Example :replace accessdate with servdate()
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 57
Function :ServTime
Compatible :S87, 5.0
Syntax :c_var=ServTime()
Description :ServTime will return the server time in clipper 99:99:99
character format. Server date and times are not synchronized
on an internetwork, so the server time will come from the
default file server. Use SetDefCon() to designate which
server to get the time (or date) from if you have multiple
servers available.
Example :replace accesstime with servtime()
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 58
Function :SetDefCon
Compatible :S87, 5.0
Syntax :SetDefCon(connection_ID)
Description :SetDefCon will set the preferred connection ID to the server
in the connection_IDth slot in the server table. The
server table can be read with A_Servers. All request to
a server will go to the new preferred after this call.
Setting the preferred connection ID to 0 will reset the
preferred server to the first server on the list.
*see DEFAULTCON() for description of server priority.
Example :&&to capture to a non-preferred (if available)
private servers(numservers())
a_servers(servers)
if ascan(servers,'SERVER-2')<>0
oldserver=defaultcon()
setdefcon(ascan(servers,'SERVER-2'))
capture('qlaser nb ti0 nt')
setdefcon(oldserver)
else
capture('qokidata_3 nb ti0 nt')
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 59
Function :SetDefLPT
Compatible :S87,5.0
Syntax :=l_var=SetDefLPT(LPT_Port)
Description :SetDefLPT is used to set the shell's default LPT port. When
requesting capture status, capture server and other information,
the functions work on the shell's default LPT port. LPT_Port
is a value from 1 to 3 representing LPT1-LPT3. SetDetLPT
returns .t. if successful.
Example 5.0 :set printer to LPT2
setdeflpt(2)
if !cap_stat()
capture('l2 qoki2410_1 ti0 nb nt')
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 60
Function :SList
Compatible :S87,5.0
Syntax :n_var=SList(s_array)
Description :SList will fill the array s_array with the server names that
the currently logged-in object is NOT attached to. N_var will
return the number of elements in s_array. This function is
generally used to get a list of servers that you may wish to
attach to or log into.
Example :private s_array[0] &&5.0
private s_array[numslist()] &&S87
a_servers(s_array)
if ascan(s_array,'ACCT_SERV')=0 &&check if already attached
slist(s_array) &&get list of unattached
&&servers
if ascan(s_array,'ACCT_SERV')<>0
&&check if server is there
if !(attach('ACCT_SERV',username,password))
&&attempt attach to new server
popmess(10,10,;
'Could not attach to the Accounting Server')
endif
else
popmess(10,10,'Accounting Server could not be found')
endif
endif
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 61
Function :UserName
Compatible :S87, 5.0
Syntax :c_var=UserName([loginname])
Description :UserName returns the full name of the specified loginname or
the user logged into the current workstation if no loginname
is specified.
Example :? 'Hello, '+UserName()
? username('RFP')
LXNet Ver. 1.3/5.1 - Novell bindery/printing functions for Clipper 62
Function :WhoAmI
Compatible :S87, 5.0
Syntax :c_var=WhoAmI()
Description :WhoAmI returns the name of the object logged into the
workstation. *Note* It is not always a user logged into
a workstation as print servers and job servers can also
login to a workstation.
Example :? 'Hello, '+WhoAmI()